﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TimScripts.BF4Rcon.Test
{
    public class MapComparer : IEqualityComparer<Map>
    {
        bool IgnoreRoundsToPlay = false;

        public bool Equals(Map x, Map y)
        {
            bool rounds = IgnoreRoundsToPlay ? true : x.RoundsToPlay == y.RoundsToPlay;

            return x.MapName == y.MapName && x.GameMode == y.GameMode && rounds;
        }

        public int GetHashCode(Map obj)
        {
            throw new NotImplementedException();
        }

        public MapComparer IgnoreRounds()
        {
            IgnoreRoundsToPlay = true;

            return this;
        }
    }
}
